Sur cette page, vous pouvez obtenir une analyse détaillée d'un mot ou d'une phrase, réalisée à l'aide de la meilleure technologie d'intelligence artificielle à ce jour:
общая лексика
заметив
A HAVING
clause in SQL specifies that an SQL SELECT
statement must only return rows where aggregate values meet the specified conditions.
HAVING
and WHERE
are often confused by beginners, but they serve different purposes. WHERE
is taken into account at an earlier stage of a query execution, filtering the rows read from the tables. If a query contains GROUP BY
, rows from the tables are grouped and aggregated. After the aggregating operation, HAVING
is applied, filtering out the rows that don't match the specified conditions. Therefore, WHERE
applies to data read from tables, and HAVING
should only apply to aggregated data, which isn't known in the initial stage of a query.
To view the present condition formed by the GROUP BY
clause, the HAVING
clause is used.